package com.topvision.service.impl;

import com.topvision.domain.SysOrderDetail;
import com.topvision.repository.SysOrderDetailRepository;
import com.topvision.service.SysOrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

@Service
public class SysOrderDetailServiceImpl implements SysOrderDetailService{

    @Autowired
    private SysOrderDetailRepository sysOrderDetailRepository;
    @Override
    public SysOrderDetail findById(Long id) {
        return sysOrderDetailRepository.findOne(id);
    }

    @Override
    public void save(SysOrderDetail sysOrderDetail) {
        sysOrderDetailRepository.save(sysOrderDetail);
    }

    @Override
    public List<SysOrderDetail> findSysOrderDetailsByOrderIdIn(List<Long> ids) {
        return sysOrderDetailRepository.findSysOrderDetailsByOrderIdIn(ids);
    }

    @Override
    public List<SysOrderDetail> findSysOrderDetailsByProductIdIn(Set<Long> ids) {
        return sysOrderDetailRepository.findSysOrderDetailsByProductIdIn(ids);
    }
}
